//
//  Header.h
//  community
//
//  Created by 小崔 on 2020/5/28.
//  Copyright © 2020 小崔. All rights reserved.
//

#ifndef Header_h
#define Header_h

//导航栏高度：
#define NAVHIGHT ((SCREEN_HEIGHT>=812.0 && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)? 101:60)

#define iPhoneXStyle ((SCREEN_WIDTH ==375.f&& SCREEN_HEIGHT ==812.f? YES : NO) || (SCREEN_WIDTH ==414.f&& SCREEN_HEIGHT ==896.f? YES : NO))


#define kVerticalSpace   ([GTAttributeConfig isFullScreen] ? 30 :0)

#define SCREENWIDTH  [UIScreen mainScreen].bounds.size.width
#define SCREENHEIGHT [UIScreen mainScreen].bounds.size.height


#define kSafeTopHeight ((SCREEN_HEIGHT>=812.0&& !IS_IPAD)? 44:0)
#define kSafeBottomHeight ((SCREEN_HEIGHT>=812.0&& !IS_IPAD) ? 34:0)
#define kSafeLRX ((SCREEN_WIDTH>=812.0&&!IS_IPAD) ? 44:0)
#define kSafeBY ((SCREEN_WIDTH>=812.0&& !IS_IPAD) ? 21:0)
#define kSafeTopHasNavHeight ((SCREEN_HEIGHT>=812.0&& !IS_IPAD)? 88:30)
#define kSafeTopNoNavHeight ((SCREEN_HEIGHT>=812.0&& !IS_IPAD)? 44:0)
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

#define SCREEN_WIDTH  ([[UIScreen mainScreen] bounds].size.width)
//高度适配动态计算
#define kAdaptWidth(x)                  (x * SCREEN_WIDTH)  / 375
#define kAdaptHeight(x)                 (x * SCREENHEIGHT) / 812



// 颜色(RGB)
#define RGBCOLOR(r, g, b)       [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define RGBACOLOR(r, g, b, a)   [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#pragma mark - 颜色
/* 十六进制颜色 */
#define Rgb2UIColor(r, g, b, a)        [UIColor colorWithRed:((r) / 255.0) green:((g) / 255.0) blue:((b) / 255.0) alpha:((a)/1.0)]


// 字体大小(常规/粗体)
#define BOLDSYSTEMFONT(FONTSIZE)[UIFont boldSystemFontOfSize:FONTSIZE]
#define SYSTEMFONT(FONTSIZE)    [UIFont systemFontOfSize:FONTSIZE]
#define FONT(NAME, FONTSIZE)    [UIFont fontWithName:(NAME) size:(FONTSIZE)]

//弱引用
#define WEAKSELF typeof(self) __weak weakSelf = self;

#endif /* Header_h */
